<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>需求</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="ibm-db2.setup.html">« 安装/配置</a></li>
      <li style="float: right;"><a href="ibm-db2.installation.html">安装 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ibm-db2.setup.html">安装/配置</a></li>
    <li>需求</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="ibm-db2.requirements" class="section">
  <h2 class="title">需求</h2>
  <p class="para">
   To connect to IBM DB2 Universal Database for Linux, UNIX, and Windows, or
   IBM Cloudscape, or Apache Derby, you must install an IBM DB2 Universal
   Database client on the same computer on which you are running PHP. The
   extension has been developed and tested with DB2 Version 8.2.
  </p>
  <p class="para">
   To connect to IBM DB2 Universal Database for z/OS or iSeries, you also
   require IBM DB2 Connect or the equivalent DRDA gateway software.
  </p>
  <div class="section" id="ibm-db2.requirements.unix">
   <h2 class="title">Requirements on Linux or Unix</h2>
   <p class="para">
    The user invoking the PHP executable or SAPI must specify the DB2 instance
    before accessing these functions. You can set the name of the DB2 instance
    in <var class="filename">php.ini</var> using the <code class="literal">ibm_db2.instance_name</code>
    configuration option, or you can source the DB2 instance profile before
    invoking the PHP executable.
   </p>
   <p class="para">
    If you created a DB2 instance named <code class="literal">db2inst1</code> in
    <var class="filename">/home/db2inst1/</var>, for example, you can add the
    following line to <var class="filename">php.ini</var>:
    <div class="example-contents screen">
<div class="cdata"><pre>
ibm_db2.instance_name=db2inst1
</pre></div>
    </div>
    If you do not set this option in <var class="filename">php.ini</var>, you must issue the
    following command to modify your environment variables to enable access to
    DB2:
    <div class="example-contents screen">
<div class="cdata"><pre>
bash$ source /home/db2inst1/sqllib/db2profile
</pre></div>
    </div>
    To enable your PHP-enabled Web server to access these functions, you must
    either set the <code class="literal">ibm_db2.instance_name</code> configuration
    option in <var class="filename">php.ini</var>, or source the DB2 instance environment in your Web
    server start script (typically <var class="filename">/etc/init.d/httpd</var> or
    <var class="filename">/etc/init.d/apache</var>).
   </p>
  </div>
 </div></div></div></body></html>